<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019/11/4
  Time: 21:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>河大附幼选课系统</title>
    <style type="text/css">
        *{
            padding: 0;
            margin: 0;
        }
        .login{
            width: 60%;
            height: 320px;
            margin-left: 15%;
            margin-top: 100px;
            opacity: 0.7;
            background-color: white;
            position: absolute;
        }
        .loginTitle{
            width: 100%;
            text-align: center;
            color: #5CACEE;
            font-size: 2.5em;
            font-family: KaiTi;
            margin-top: 5%;
        }
        .password{
            width: 60%;
            margin-left: 20%;
            margin-top: 5%;
            text-align: center;
            font-size: 18px;
            font-family: KaiTi;
            color: #5CACEE;
        }
        .in{
            width: 80%;
            height: 32px;
            margin-left: 10px;
            text-indent: 10px;
            font-size: 18px;
            font-family: KaiTi;
            color: #5CACEE;
            opacity: 0.8;
            border:1px solid #5CACEE;
        }
        input::-webkit-input-placeholder{
            color: #5CACEE;
        }
        .button{
            width: 100%;
            margin-top: 10%;
            margin-left: 70px;
        }
        .btn_reset{
            width: 20%;
            height: 32px;
            margin-left: 12%;
            border: none;
            outline:none;
            background-color: #5CACEE;
            color: white;
            cursor:pointer;
        }
        button:hover{
            background-color: #0099FF;
        }
    </style>
    <script type="text/javascript">
        var msg = ${msg};
        if(msg == 6){
            parent.location.href="t_login?msg=5";
        }
    </script>

</head>
<body>
<div class="login">
    <div class="loginTitle">
        <p style="margin-top: 10px">修改密码界面</p>
    </div><br><br>
    <div>
            <div style="font-family: KaiTi;color: #5CACEE;font-size: 20px;margin-left: 160px;">
                教工号:${teacher.gettea_account()}<br>
            </div><br>
            <div class="password">
                <input type="password" name="password" id="password" placeholder="请输入新密码" autocomplete="off" class="in" /><br>
            </div>
            <div class="password">
                <input type="password" name="newpassword" id="newpassword" placeholder="请再次确认密码" class="in" />
            </div>
            <div class="button">
                <button onclick="confirmPassword()"class="btn_reset">确认</button>
                <button class="btn_reset" type="reset">重置</button>
            </div>
    </div>
</div>
</body>
<script type="text/javascript">
    var confirmPassword = function () {
        var password = $('#password').val();
        var newpassword = $('#newpassword').val();
        if(password==null||password==""||newpassword==null||newpassword==""){
            alert("请正确输入");
        }
        else if(password==newpassword){
            //两次输入密码相等
            window.location.href="changePassword?password="+password;
        }else {
            alert("两次密码输入不一致");
            $("#password").val("");//置空
            $("#newpassword").val("");
        }
    }
    function goReturn() {
        window.history.go(-1);
    }
</script>
</html>